﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Add.aspx.cs" Inherits="SysAdmin_User_Add" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<body>
    <script type="text/javascript">
        $(function () {
            //初始化数据
            $('#user_add_rolecombobox').combobox({
                url: 'Ashx/GetRoleComboBox.ashx',
                valueField: 'id',
                textField: 'text',
                onLoadSuccess: function () {
                    //首次加载成功后加载默认选择的
                },
                onSelect: function (node) {
                    //加载选择的角色权限
                    if (node) {
                        $.ajax({
                            type: "POST",
                            url: 'Ashx/GetRolePower.ashx',
                            data: "roleCode=" + node.id,
                            dataType: "json",
                            success: function (msg) {
                                $('#user_add_powercombox').combotree('setValues', msg);
                            }
                        });
                    }

                }
            });
        });
    </script>
    <div style="text-align: center;">
        <form id="admin_user_addForm" method="post">
            <table class="tableForm" style="width: 100%;">
                <tr>
                    <th style="width: 100px;">用户名</th>
                    <td>
                        <input name="user_name" class="easyui-validatebox" data-options="required:true" style="width: 150px;" /></td>
                    <th style="width: 100px;">密码</th>
                    <td>
                        <input name="user_pwd" type="password" class="easyui-validatebox" data-options="required:true" style="width: 150px;" /></td>
                </tr>
                <tr>
                    <th>真实姓名</th>
                    <td>
                        <input name="user_full_name" id="user_real_name" /></td>
                    <th>性别</th>
                    <td>
                        <input id="user_add_sexcombobox" name="user_sex" class="easyui-combobox" data-options="url:'Ashx/GetDicComboBox.ashx?dic_key=sex',valueField: 'id',textField: 'text'" /><img src="Images/cut_red.png" onclick="$('#user_add_sexcombobox').combobox('clear');" />
                    </td>
                </tr>
                <tr>
                    <th>角色</th>
                    <td>
                        <input name="user_add_rolecombobox" id="user_add_rolecombobox" /><img src="Images/cut_red.png" onclick="$('#user_add_rolecombobox').combobox('clear');" />
                    </td>
                    <th>出生日期</th>
                    <td>
                        <input id="user_add_birthday" name="user_add_birthday" type="text" class="easyui-datebox" /><img src="Images/cut_red.png" onclick="$('#user_add_birthday').datebox('clear');" />
                    </td>
                </tr>
                <tr>
                    <th>权限</th>
                    <td colspan="3">
                        <input id="user_add_powercombox" name="user_add_powercombox" class="easyui-combotree" data-options="url:'Ashx/GetAllPower.ashx',parentField : 'pid',lines : true,multiple:true,onlyLeafCheck:true" style="width: 370px;" /><img src="Images/cut_red.png" onclick="$('#user_add_powercombox').combotree('clear');" />
                    </td>
                </tr>
            </table>
            <input id="usre_default_role" type="hidden" value="" />
        </form>
    </div>
</body>
</html>
